package HUZ_FileIO;

import java.io.File;
import java.io.IOException;
import java.util.stream.Stream;

public class demo3 {
    public static void main(String[] args) throws IOException {
        File file1=new File("E:\\Java网络通信程序\\TestDemo1");
        //获取指定路径下的所有文件名
        String[] list = file1.list();
        Stream.of(list).forEach(fileName-> System.out.println(fileName));
        //获取该文件路径下的绝对路径
        String canonicalPath = file1.getCanonicalPath();
        System.out.println(canonicalPath);
        //检查文件是否可读
        boolean b = file1.canRead();
        System.out.println(b);


    }
}
